home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / PictUtils.a < prev    next >
Encoding:
Text File  |  1997-08-12  |  7.4 KB  |  211 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        PictUtils.a
  3. ;
  4. ;    Contains:    Picture Utilities Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.0.1
  8. ;
  9. ;    Copyright:    © 1990-1997 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__PICTUTILS__') = 'UNDEFINED' THEN
  19. __PICTUTILS__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__PALETTES__') = 'UNDEFINED' THEN
  25.     include 'Palettes.a'
  26.     ENDIF
  27.  
  28. ;  verbs for the GetPictInfo, GetPixMapInfo, and NewPictInfo calls 
  29.  
  30. returnColorTable                EQU        $0001
  31. returnPalette                    EQU        $0002
  32. recordComments                    EQU        $0004
  33. recordFontInfo                    EQU        $0008
  34. suppressBlackAndWhite            EQU        $0010
  35.  
  36.                                                             ; color pick methods 
  37. systemMethod                    EQU        0                    ; system color pick method 
  38. popularMethod                    EQU        1                    ; method that chooses the most popular set of colors 
  39. medianMethod                    EQU        2                    ; method that chooses a good average mix of colors 
  40.                                                             ; color bank types 
  41. ColorBankIsCustom                EQU        -1
  42. ColorBankIsExactAnd555            EQU        0
  43. ColorBankIs555                    EQU        1
  44. ; typedef long                             PictInfoID
  45.  
  46. CommentSpec                RECORD 0
  47. count                     ds.w    1                ; offset: $0 (0)        ;  number of occurrances of this comment ID 
  48. ID                         ds.w    1                ; offset: $2 (2)        ;  ID for the comment in the picture 
  49. sizeof                     EQU *                    ; size:   $4 (4)
  50.                         ENDR
  51. ; typedef struct CommentSpec *            CommentSpecPtr
  52.  
  53. ; typedef CommentSpecPtr *                CommentSpecHandle
  54.  
  55. FontSpec                RECORD 0
  56. pictFontID                 ds.w    1                ; offset: $0 (0)        ;  ID of the font in the picture 
  57. sysFontID                 ds.w    1                ; offset: $2 (2)        ;  ID of the same font in the current system file 
  58. size                     ds.l    4                ; offset: $4 (4)        ;  bit array of all the sizes found (1..127) (bit 0 means > 127) 
  59. style                     ds.w    1                ; offset: $14 (20)        ;  combined style of all occurrances of the font 
  60. nameOffset                 ds.l    1                ; offset: $16 (22)        ;  offset into the fontNamesHdl handle for the font’s name 
  61. sizeof                     EQU *                    ; size:   $1A (26)
  62.                         ENDR
  63. ; typedef struct FontSpec *                FontSpecPtr
  64.  
  65. ; typedef FontSpecPtr *                    FontSpecHandle
  66.  
  67. PictInfo                RECORD 0
  68. version                     ds.w    1                ; offset: $0 (0)        ;  this is always zero, for now 
  69. uniqueColors             ds.l    1                ; offset: $2 (2)        ;  the number of actual colors in the picture(s)/pixmap(s) 
  70. thePalette                 ds.l    1                ; offset: $6 (6)        ;  handle to the palette information 
  71. theColorTable             ds.l    1                ; offset: $A (10)        ;  handle to the color table 
  72. hRes                     ds.l    1                ; offset: $E (14)        ;  maximum horizontal resolution for all the pixmaps 
  73. vRes                     ds.l    1                ; offset: $12 (18)        ;  maximum vertical resolution for all the pixmaps 
  74. depth                     ds.w    1                ; offset: $16 (22)        ;  maximum depth for all the pixmaps (in the picture) 
  75. sourceRect                 ds        Rect            ; offset: $18 (24)        ;  the picture frame rectangle (this contains the entire picture) 
  76. textCount                 ds.l    1                ; offset: $20 (32)        ;  total number of text strings in the picture 
  77. lineCount                 ds.l    1                ; offset: $24 (36)        ;  total number of lines in the picture 
  78. rectCount                 ds.l    1                ; offset: $28 (40)        ;  total number of rectangles in the picture 
  79. rRectCount                 ds.l    1                ; offset: $2C (44)        ;  total number of round rectangles in the picture 
  80. ovalCount                 ds.l    1                ; offset: $30 (48)        ;  total number of ovals in the picture 
  81. arcCount                 ds.l    1                ; offset: $34 (52)        ;  total number of arcs in the picture 
  82. polyCount                 ds.l    1                ; offset: $38 (56)        ;  total number of polygons in the picture 
  83. regionCount                 ds.l    1                ; offset: $3C (60)        ;  total number of regions in the picture 
  84. bitMapCount                 ds.l    1                ; offset: $40 (64)        ;  total number of bitmaps in the picture 
  85. pixMapCount                 ds.l    1                ; offset: $44 (68)        ;  total number of pixmaps in the picture 
  86. commentCount             ds.l    1                ; offset: $48 (72)        ;  total number of comments in the picture 
  87. uniqueComments             ds.l    1                ; offset: $4C (76)        ;  the number of unique comments in the picture 
  88. commentHandle             ds.l    1                ; offset: $50 (80)        ;  handle to all the comment information 
  89. uniqueFonts                 ds.l    1                ; offset: $54 (84)        ;  the number of unique fonts in the picture 
  90. fontHandle                 ds.l    1                ; offset: $58 (88)        ;  handle to the FontSpec information 
  91. fontNamesHandle             ds.l    1                ; offset: $5C (92)        ;  handle to the font names 
  92. reserved1                 ds.l    1                ; offset: $60 (96)
  93. reserved2                 ds.l    1                ; offset: $64 (100)
  94. sizeof                     EQU *                    ; size:   $68 (104)
  95.                         ENDR
  96. ; typedef struct PictInfo *                PictInfoPtr
  97.  
  98. ; typedef PictInfoPtr *                    PictInfoHandle
  99.  
  100. ;
  101. ; pascal OSErr GetPictInfo(PicHandle thePictHandle, PictInfo *thePictInfo, short verb, short colorsRequested, short colorPickMethod, short version)
  102. ;
  103.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  104.         Macro
  105.         _GetPictInfo
  106.             move.w              #$0800,D0
  107.             dc.w                $A831
  108.         EndM
  109.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  110.         IMPORT_CFM_FUNCTION GetPictInfo
  111.     ENDIF
  112.  
  113. ;
  114. ; pascal OSErr GetPixMapInfo(PixMapHandle thePixMapHandle, PictInfo *thePictInfo, short verb, short colorsRequested, short colorPickMethod, short version)
  115. ;
  116.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  117.         Macro
  118.         _GetPixMapInfo
  119.             move.w              #$0801,D0
  120.             dc.w                $A831
  121.         EndM
  122.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  123.         IMPORT_CFM_FUNCTION GetPixMapInfo
  124.     ENDIF
  125.  
  126. ;
  127. ; pascal OSErr NewPictInfo(PictInfoID *thePictInfoID, short verb, short colorsRequested, short colorPickMethod, short version)
  128. ;
  129.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  130.         Macro
  131.         _NewPictInfo
  132.             move.w              #$0602,D0
  133.             dc.w                $A831
  134.         EndM
  135.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  136.         IMPORT_CFM_FUNCTION NewPictInfo
  137.     ENDIF
  138.  
  139. ;
  140. ; pascal OSErr RecordPictInfo(PictInfoID thePictInfoID, PicHandle thePictHandle)
  141. ;
  142.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  143.         Macro
  144.         _RecordPictInfo
  145.             move.w              #$0403,D0
  146.             dc.w                $A831
  147.         EndM
  148.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  149.         IMPORT_CFM_FUNCTION RecordPictInfo
  150.     ENDIF
  151.  
  152. ;
  153. ; pascal OSErr RecordPixMapInfo(PictInfoID thePictInfoID, PixMapHandle thePixMapHandle)
  154. ;
  155.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  156.         Macro
  157.         _RecordPixMapInfo
  158.             move.w              #$0404,D0
  159.             dc.w                $A831
  160.         EndM
  161.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  162.         IMPORT_CFM_FUNCTION RecordPixMapInfo
  163.     ENDIF
  164.  
  165. ;
  166. ; pascal OSErr RetrievePictInfo(PictInfoID thePictInfoID, PictInfo *thePictInfo, short colorsRequested)
  167. ;
  168.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  169.         Macro
  170.         _RetrievePictInfo
  171.             move.w              #$0505,D0
  172.             dc.w                $A831
  173.         EndM
  174.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  175.         IMPORT_CFM_FUNCTION RetrievePictInfo
  176.     ENDIF
  177.  
  178. ;
  179. ; pascal OSErr DisposePictInfo(PictInfoID thePictInfoID)
  180. ;
  181.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  182.         Macro
  183.         _DisposePictInfo
  184.             move.w              #$0206,D0
  185.             dc.w                $A831
  186.         EndM
  187.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  188.         IMPORT_CFM_FUNCTION DisposePictInfo
  189.     ENDIF
  190.  
  191.     IF OLDROUTINENAMES THEN
  192. ;
  193. ; pascal OSErr DisposPictInfo(PictInfoID thePictInfoID)
  194. ;
  195.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  196.         Macro
  197.         _DisposPictInfo
  198.             move.w              #$0206,D0
  199.             dc.w                $A831
  200.         EndM
  201.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  202.         IMPORT_CFM_FUNCTION DisposPictInfo
  203.     ENDIF
  204.  
  205.     ENDIF    ; OLDROUTINENAMES
  206.  
  207.  
  208.  
  209.     ENDIF ; __PICTUTILS__ 
  210.  
  211.